//
//  NSObject+exchangeMethon.m
//  动态创建对象
//
//  Created by MyMac on 15/8/27.
//  Copyright (c) 2015年 MyMac. All rights reserved.
//

#import "NSObject+exchangeMethon.h"
#import <objc/runtime.h>
@interface NSMutableArray()

@end
@implementation NSMutableArray (exchangeMethon)
//类或分类在运行时调用一次
+(void)load
{
    Method old= class_getInstanceMethod([self class], @selector(addObject:));
    Method new=class_getInstanceMethod([self class], @selector(newAddObject:));
    method_exchangeImplementations(old, new);


}
- (void)newAddObject:(id)object;
{
//    [self newAddObject:object];
    NSLog(@"%@",self);



}
@end
